package com.ym.medical.service.impl;

import com.ym.core.utils.tkmybatis.BaseSVImpl;
import com.ym.medical.dao.DoctorPhoneSettingDao;
import com.ym.medical.domain.entity.DoctorPhoneSettingEntity;
import com.ym.medical.domain.param.DoctorPhoneSettingUpdateParam;
import com.ym.medical.service.IDoctorPhoneSettingSV;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
                                                                    
/**
* 电话问诊规则Service业务层处理
*
* @author ym
* @date 2020-09-14
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class DoctorPhoneSettingSVImpl extends BaseSVImpl<DoctorPhoneSettingEntity,DoctorPhoneSettingDao> implements IDoctorPhoneSettingSV {

	/**
	 * 新增电话问诊规则
	 *
	 * @param updateParam 电话问诊规则 新增参数
	 * @return 结果
	 */
	@Override
	public Long insertPC(DoctorPhoneSettingUpdateParam updateParam) {
            DoctorPhoneSettingEntity entity = updateParam.covert();
		this.insert(entity);
		return entity.getId();
	}

	/**
	 * 修改电话问诊规则
	 *
	 * @param updateParam 电话问诊规则 修改参数
	 * @return 结果
	 */
	@Override
	public int updateByIdPC(DoctorPhoneSettingUpdateParam updateParam) {
            DoctorPhoneSettingEntity entity = updateParam.covert("createTime");
		int result = this.updateById(entity);
		return result;
	}
}
